//
//  SearchCollectionViewCell.m
//  礼物说
//
//  Created by dllo on 16/4/28.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "SearchCollectionViewCell.h"

@interface SearchCollectionViewCell ()

@property (nonatomic, retain) BaseLabel *lable;

@end

@implementation SearchCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)dealloc {
    [_str release];
    [_lable release];
    [super dealloc];
}

- (void)setStr:(NSString *)str {
    if (_str != str) {
        [_str release];
        _str = [str retain];
    }
    
    _lable.text = _str;
}

- (void)createCell {
    
    self.lable = [[BaseLabel alloc] init];
    [self.contentView addSubview:_lable];
    [_lable release];
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    _lable.frame = self.contentView.frame;
    _lable.textAlignment = NSTextAlignmentCenter;
    _lable.tintColor = [UIColor grayColor];
}

@end
